﻿using mscook.core.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Linq;

namespace mscook.core.repositories
{
    public class RelativeInfoRepository:Repository<RelativeInfo>, mscook.core.repositories.IRelativeInfoRepository
    {
        public IList<RelativeInfo> GetByResourceId(string resourceId)
        {
            var query = (from x in this.Session.Query<RelativeInfo>() select x)
             .Where(o => o.IsDelete == false
                 && o.ResourceID == resourceId).OrderByDescending(o => o.EntityIndex);
            return query.ToList();
        }

    }
}
